"""
Решение 2 этапа IT-марафона по программированию
"""
phrase = input()
brackets_open = "([{<"
brackets_close =  ")]}>"
mystack = []
brackets_match = True
counter = 0
for char in phrase:
    if char in brackets_open:
        mystack.append(char)
    if char in brackets_close:
        if len(mystack) == 0 or brackets_close.find(char) != brackets_open.find(mystack.pop()):
            brackets_match = False
        break
if len(mystack) == 0 and brackets_match:
    print("Верная")
else:
    print("Неверная")
